<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <style>
    /*弹窗*/

        body {
            background: transparent;
        }

        #header .back {
            padding: 0;
            width: 1.25rem;
        }

        .popBox {
            padding: 0 1rem;
            height: 100%;
            background: #fff;
            top: 0;
            width: 100%;
        }

        .popBox .success {
            text-align: center;
            padding-bottom: 1.2rem;
        }

        .popBox .success .text {
            padding-top: 0.6rem;
            font-size: 0.9rem;
        }

        .popBox .success div>img {
            height: 2.1rem;
            margin: 0 auto;
            width: 2rem;
        }

        .title {
            font-size: 0.6rem;
        }

        .infoBox {
            border-top: 1px dashed #eee;
            border-bottom: 1px dashed #eee;
            line-height: 1.5rem;
            padding: 0.8rem 0;
        }

        .bomBtn {
            padding: 0 0.75rem;
            margin-top: 1.2rem;
        }

        .bomBtn>div {
            width: 7rem;
            height: 2rem;
            line-height: 2rem;
            background: #E73550;
            font-size: 0.6rem;
            border-radius: 0.2rem;
            color: #fff;
            text-align: center;
        }

        .bomBtn>div.frist {
            margin-right: 0.7rem;
        }

        @media (max-width:320px) {
            .bomBtn>div {
                width: 6rem;
            }
            .bomBtn>div.frist {
                margin-right: 0.45rem;
            }
        }

        @media (max-width:360px) {
            .bomBtn>div {
                width: 6rem;
            }
        }

        .bomBtn {
            padding: 0 0.35rem;
        }
    }
    </style>
</head>

<body>
    <div class="popOverlay" tapmode onClick="api.closeFrame();"></div>
    <div class="popBox">
        <div class="aui-bar aui-bar-nav" id="header">
            <div class="aui-pull-left back" tapmode onclick="api.closeWin()"></div>
        </div>
        <div class="success">
            <div><img src="../../image/common/17.png" alt=""></div>
            <div class="color-e7 text">兑换成功</div>
        </div>
        <div class="infoBox dashed aui-flex-col aui-font-size-12">
            <div class="aui-flex-item-12">
                <div class="title aui-flex-item-4">支付积分（枚）</div>
                <div id="totalUcoin">0</div>
            </div>
            <div class="aui-flex-item-12">
                <div class="title aui-flex-item-4">兑换商品</div>
                <div class="aui-flex-row">
                    <div class="aui-flex-col aui-flex-between">
                        <div class="flex-auto aui-ellipsis-1" id="name"></div>
                        <div></div>
                        <div id="count">0</div>
                    </div>
                </div>
            </div>
            <div class="aui-flex-item-12">
                <div class="title aui-flex-item-4">剩余积分（枚）</div>
                <div id="youUcion">0</div>
            </div>
        </div>
        <div class="bomBtn aui-flex-col aui-flex-center">
            <div class="frist" tapmode onclick="openWin('../mine/money_win')">继续兑换</div>
            <div tapmode onclick="openWin('../mine/order1_win')">查看订单</div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
    apiready = function() {
      var header = $api.byId('header');
      $api.fixStatusBar(header);
        api.parseTapmode();
        api.ajax({
            url: BASE_URL + 'App/User/getUCion',
            method: 'post',
            data: {
                values: {
                    userid: getUserId()
                }
            }
        },function(ret, err){
            if (ret) {
              $$('#youUcion').text(ret.user_coin)
            } else {
                alert( JSON.stringify( err ) );
            }
        });
        if (api.pageParam.name) {
            $$('#name').text(api.pageParam.name)
        }
        if (api.pageParam.count) {
            $$('#count').text(api.pageParam.count)
        }
        if (api.pageParam.totalUcoin) {
            $$('#totalUcoin').text(api.pageParam.totalUcoin)
        }
    };

    function openWin(url) {
        api.openWin({
            name: url,
            url: url + '.html'
        });
    }
</script>

</html>
